1. Field of the Invention
The present invention provides a method for determining if an image from a scanner has occurrences of scan line misalignments. More particularly, a software method enabling a program to determine if an image from a scanner has occurrences of scan line misalignments is disclosed.
2. Description of the Prior Art
Scanners are popular computer peripherals that are used to digitize documents or pictures so that they may be stored on a computer. To ensure a high quality of these scanned images, manufacturers strive to increase the resolution of the images, and to make their colors more brilliant. But a key factor affecting the quality of scanned images is the stability of the scanning module. If the stability of the scanning module is insufficient, the images from a scanner may have misalignments or entire deletions of scan lines in the image.
Please refer to FIG. 1. FIG. 1 is a schematic diagram of a prior art method to determine if there are any occurrences of scan line deletions in an image 10. The test is performed after the scanner has been completely manufactured, and involves the scanning of the test image 10. Testing personnel then analyze the results. As shown in FIG. 1, if a missed scan line 12 is observed by the testing personnel, the scanner is returned to the factory for adjustments. This visual method to determine if a scanner misses scan lines is both time consuming and relatively inaccurate.
Please refer to FIG. 2. FIG. 2 is a schematic diagram of another prior art method that uses a scanned test image 20 to determine if a scanner misses scan lines. The test image 20 is produced by the scanner to be tested by scanning a test picture. Each grid element, such as 24 or 26 in FIG. 2, represents a gray-scale value of a scanned test image pixel from the scanner after scanning the test picture, which has an axis of symmetry at 45 degrees. The range of the gray-scale values are from 0 to 255. The smaller the gray-scale values are, the darker the corresponding image pixels are. The larger the gray-scale values are, the brighter the corresponding image pixels are. The region 28 represents an image region after scanning the test picture, and its pixel values are almost all less than 30.
In this prior art, a search is performed within the scanned test image 20 to find the positions of the boundary points of the test image 20, and then pixel values within the boundary points are tested against diagonally adjacent pixel values. For example, I(X,Y) represents the pixel value of the test image 20 at the Xth column and the Yth line. A simple program is used to compare the pixel value I(i) of a point (X,Y) and the pixel value I(i+1) of another point (Xxe2x88x921, Y+1). If the difference between I(i) and I(i+1) is too large, then it is assumed that a scan line 22 is missing between the lines (Y) and (Y+1).
Hence, the prior art compares two adjacent lines and determines if the scanned test image 20 conforms to the expected 45 degree symmetry of the test picture. The minimum unit required to determine if a scan line has been skipped is one pixel. This is not accurate enough to satisfy the requirements of a high-end scanner.
It is therefore an objective of the present invention to provide a method for determining scan line misalignments of a scanner.
Briefly, the present invention scans a test image that has a black bias on a white background. The black bias is a line set at about 45 degrees to the scan lines of the scanner. The method involves finding boundary points of the scanned bias, calculating a regression line from the positions of the boundary points, using differences in the position of adjacent boundary points together with the slope reciprocal of the regression line to determine error values, and comparing the error values with a gate value to determine if there are any occurrences of scan line misalignment.
It is an advantage that the present invention can detect scan line misalignments with sub-pixel accuracy, thus fulfilling the more rigid requirements for high-level scanners.
These and other objectives of the present invention will no doubt become obvious to these of ordinary skill in the art after reading the following detailed description of the preferred embodiment, which is illustrated in the various figures and drawings.